package org.phpgwt.tester.client.tests;

import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.RootPanel;

public abstract class PhpGwtTest {

	private static void print(String text) {
		RootPanel.get().add(new HTML(text));
	}

	protected static void printResult(String test, Throwable caught) {
		print("<div style=\"color:red;\">" + test + " ERROR: " + caught.getMessage() + "</div>");
	}

	protected static void printResult(String test, Object actual, Object expected) {
		if (expected.equals(actual)) {
			print("<div style=\"color:green;\">" + test + ": OK</div>");
		} else {
			print("<div style=\"color:red;\">" + test + ": FAILED (result:" + actual + ")</div>");
		}
	}
}
